<template>

    <view class="container">

        <view class="mineInfo">
            <view class="banner">
                <image :src="iconUrl+'我的banner.png'"></image>
            </view>
            <view class="content">
                <view class="set" @click="toSet">
                    <image mode="heightFix" :src="iconUrl+'设置.png'"></image>
                    <text>设置</text>
                </view>
                <view class="authInfo">
                    <view view class="head">
                        <image mode="heightFix" :src="iconUrl+'头像.png'"></image>
                    </view>
                    <view class="phoneAuth">
                        <text>{{merchantInfo.merLinktel}}</text>
                    </view>
                </view>
            </view>
        </view>

        <view class="corp-info">
            <view class="corp-image">
                <image mode="heightFix" :src="iconUrl+'corp.png'"></image>
            </view>
            <view class="corp-title">
                企业介绍
            </view>
        </view>
        <view class="divLine"></view>
        <view class="corp-text">
            <text v-if="merchantInfo.remarks!== ''">
            {{merchantInfo.remarks}}
            </text>
            <text v-if="merchantInfo.remarks=== ''">
                暂无介绍
            </text>
        </view>


        <view class="bottom"></view>
        <u-tabbar v-model="current" :list="tarBarList" :mid-button="merType === '2'"></u-tabbar>
    </view>

</template>

<script>
    import tabBar from '@/static/js/tabBar.js';

    export default {
        data() {
            return {
                iconUrl: this.iconUrl,
                list: [{
                    name: '已报名',
                }, {
                    name: '已录用',
                }],
                tarBarList: [],
                current: 0,
                merType: '2',
                merchantInfo: {
                    remarks:'',
                    merLinktel: ''
                },
            }
        },
        onPullDownRefresh() {
            //监听下拉刷新动作的执行方法，每次手动下拉刷新都会执行一次
            setTimeout(function () {
                uni.stopPullDownRefresh();  //停止下拉刷新动画
            }, 500);
            this.getUserInfo();
        },
        created() {
            this.tarBarList = tabBar.getBarList(this.merType, this.iconUrl);
            this.getUserInfo();
        },
        onShow() {
            this.getData();
        },
        methods: {
            getData() {
                this.getUserInfo();
            },
            getUserInfo() {
                //查询用户信息
                this.$sendRequest({
                    url: '/api/wx/getMerchantInfo',
                    method: 'POST',
                    data:{
                        merId: uni.getStorageSync('mer_id'),
                    },
                    success: (cts) => {
                        this.merchantInfo = cts.data;
                        console.log(this.merchantInfo)
                    }
                });
            },
            toSet() {
                uni.navigateTo({
                    url: '/pages/mine/set'
                });
            }
        }
    }
</script>


<style lang="scss">
    page{
        background-color: #F8F8F8;
    }
    .container {
        margin: 0rpx 20rpx;

        .banner image {
            width: 710rpx;
            height: 280rpx;
        }

        .mineInfo {
            position: relative;

            .content {
                position: absolute;
                top: 30rpx;
                width: 710rpx;
                height: 260rpx;

                .set {
                    display: flex;
                    justify-content: flex-end;
                    padding-right: 30rpx;

                    image {
                        width: 64rpx;
                        height: 30rpx;
                    }

                    text {
                        display: block;
                        font-size: 24rpx;
                        margin-left: 6rpx;
                        color: #FFFFFF;
                    }
                }

                .authInfo {
                    margin-top: 20rpx;
                    display: flex;

                    .head {
                        padding: 0 30rpx 0 30rpx;

                        image {
                            height: 100rpx;
                        }
                    }

                    .phoneAuth {
                        display: flex;
                        padding: 5rpx 0;
                        flex-direction: column;

                        text {
                            display: block;
                            font-size: 36rpx;
                            color: #FFFFFF;
                            margin-bottom: 10rpx;
                        }

                        image {
                            height: 40rpx;
                        }
                    }
                }
            }
        }

        .corp-info{
            display: flex;
            margin-top: 80rpx;
            .corp-image{
                image{
                    width:80rpx;
                    height: 80rpx;
                }
            }
            .corp-title{
                margin-top: 30rpx;
                font-size: 30rpx;
                color: #1B86FF;
                font-weight: bold;
            }
        }
        .corp-text{
            height:600rpx;
            text{
                text-indent:50rpx;
                display: block;
                margin-top: 50rpx;
            }
        }
        .bottom {
            display: block;
            height: 10rpx;
            margin-bottom: 10rpx;
        }
        .divLine{
            background: #F1F1F1;
            width: 100%;
            height: 2rpx;
        }
    }
</style>
